package com.jimmy.medical.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 医院
 *
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "hospital")
public class Hospital extends AbstractEntity {
    /**
     * 医院名称
     */
    @Column(name = "name", length = 100)
    private String name;
    /**
     * 备注
     */
    @Column(name = "description", length = 500)
    private String description;
    /**
     * LOGO
     */
    //@Column(name = "logo", length = 128)
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "logo")
    @NotFound(action = NotFoundAction.IGNORE)
    private UploadFile logo;

    /** 所在城市*/
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "city_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private SysCode city;

    @Column(name = "create_time", length = 20)
    private String createTime;
    @Column(name = "create_user", length = 50)
    private String createUser;
    @Column(name = "update_time")
    private String updateTime;
    @Column(name = "update_user", length = 20)
    private String updateUser;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public UploadFile getLogo() {
        return logo;
    }

    public void setLogo(UploadFile logo) {
        this.logo = logo;
    }

    public SysCode getCity() {
        return city;
    }

    public void setCity(SysCode city) {
        this.city = city;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
}
